<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
  <!-- JSON 可以在jsp中直接写并访问 -->
  <script type="text/javascript">
			var json = {
				"id" : 1,
				"username" : "root",
				"phone" : "13333333333",
				"email" : "root@tedu.com",
				"skill" : [ "JAVA", "Mysql", "SSM", "AJAX", "在浏览器的Console中看数据",
						"访问网站为:http://localhost:8080/AJAX/" ]
			department:{
				"id":136,
				"name":"RD"}
			};
			console.log(json.id);
			console.log(json.username);
			console.log(json.phone);
			console.log(json.email);
			/*通过下标访问数据  */
			console.log(json.skill[0]);
			/* 输出长度 */
			console.log("length=" + json.skill.length);
			/*通过遍历拿出数组中的每个元素  */
			for (var i = 0; i < json.skill.length; i++) {
				console.log(json.skill[i])
			}
			console.log(json.department.name);
		</script>
</body>
</html>